<style>
    #div1 {
        position: fixed;
        top: 0;
        left: 0;
        overflow-x: hidden;
        overflow-y: scroll;
        width: 100%;
        height: 100%;
    }
</style>
<div id="div1">
    akjsdbajksdlaksd
    <br>
    akjsdbajksdlaksd
    <br>
    akjsdbajksdlaksd
    <br>
    akjsdbajksdlaksd
    <br>
    akjsdbajksdlaksd
    <br>
    akjsdbajksdlaksd
    <br>
    akjsdbajksdlaksd
    <br>
    akjsdbajksdlaksd
    <br>
    akjsdbajksdlaksd
    <br>
    akjsdbajksdlaksd
    <br>
    akjsdbajksdlaksd
    <br>
    akjsdbajksdlaksd
    <br>
    akjsdbajksdlaksd
    <br>
    akjsdbajksdlaksd
    <br>
    akjsdbajksdlaksd
    <br>
    akjsdbajksdlaksd
    <br>
    akjsdbajksdlaksd
    <br>
    akjsdbajksdlaksd
    <br>
    akjsdbajksdlaksd
    <br>
    akjsdbajksdlaksd
    <br>
    akjsdbajksdlaksd
    <br>
    akjsdbajksdlaksd
    <br>
    akjsdbajksdlaksd
    <br>
    akjsdbajksdlaksd
    <br>
    akjsdbajksdlaksd
    <br>
    akjsdbajksdlaksd
    <br>
    akjsdbajksdlaksd
    <br>
    akjsdbajksdlaksd
    <br>
    akjsdbajksdlaksd
    <br>
    akjsdbajksdlaksd
    <br>
    akjsdbajksdlaksd
    <br>
    akjsdbajksdlaksd
    <br>
    akjsdbajksdlaksd
    <br>
    akjsdbajksdlaksd
    <br>
    akjsdbajksdlaksd
    <br>
    akjsdbajksdlaksd
    <br>
    akjsdbajksdlaksd
    <br>
    akjsdbajksdlaksd
    <br>
    akjsdbajksdlaksd
    <br>
    akjsdbajksdlaksd
    <br>
    akjsdbajksdlaksd
    <br>
    akjsdbajksdlaksd
    <br>
    akjsdbajksdlaksd

</div>

<script>
    function onScroll(el, cb) {
        if (!el) {
            cb && cb.call(this, el);
            return;
        }
        const RS = { sh: 0, vh: 0, y: 0, sum: 0 };
        el.onscroll = function (e) {
            RS.y = el.scrollTop || el.pageYOffset || 0;
            RS.vh = window.innerHeight || document.documentElement.clientHeight || 0;
            RS.sum = el.scrollHeight || 0;
            RS.sh = Math.abs(RS.sum - RS.vh);
            cb && cb.call(this, el, e, RS);
        }
    }


    const lss = [{ id: 1 }, { id: 2 }, { id: 3 }];

    onScroll(div1, function (that, e, data) {
        console.log('data:', data);
        const { sh, vh, y, sum } = data;
        const temp = [0];
        for (let i = 0, o = null, l = lss.length; i < l; i++) {
            o = lss[i];
            // temp.push({ id: o.id, h: sh / (l - i) });
            temp.push(Math.ceil(sh / (l - i)));
        }

        // temp.push(Math.ceil(sh + (sh / lss.length)));
        console.log('temp:', JSON.stringify(temp));

        for (let j = 0, d = null, l2 = temp.length; j < l2; j++) {
            if (temp[j] < y && y <= temp[j + 1]) {
                console.log('满足 j:', j);
                break;
            }
        }
    });

</script>